﻿@using SCMS.Resource
@model SCMS.UI.Models.TravelDate
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "TADateDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action("SaveTADates/" + ViewBag.TAuthId),
      //OnBegin = "checkBalance",
      OnSuccess = string.Format("CloseDialog();usermsgg('{0}');", Resources.TravelAuthorization_LoadTravelDate_DateAddedSuccessfully)
  };}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form", @id = "frmTAuthDate" }))
{
    @Html.ValidationSummary(true)
    <table>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.TravelAuthorization_LoadTravelDate_TravelDate:
            </td>
            <td align="left" class="editor-field">
                @Html.EditorFor(m => m.EntityTDate.TravalDate)
                @Html.ValidationMessageFor(m => m.EntityTDate.TravalDate)
                <input type="hidden" name="TravelAuthorizationId" id="TravelAuthorizationId" value="@ViewBag.TAuthId" />
            </td>
            <td align="right" valign="top" class="editor-label">
                @Resources.Global_String_Destination
            </td>
            <td align="left" class="editor-field">
                @Html.TextAreaFor(model => model.EntityTDate.Destination)
                @Html.ValidationMessageFor(model => model.EntityTDate.Destination)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.TravelAuthorization_String_NoOfNights:
            </td>
            <td align="left" class="editor-field">@Html.EditorFor(model => model.EntityTDate.NoOfNights)
                @Html.ValidationMessageFor(model => model.EntityTDate.NoOfNights)
            </td>
            <td align="right" valign="top" class="editor-label">
                @Resources.TravelAuthorization_String_PerDiemDailyRate:
            </td>
            <td align="left" class="editor-field">
                @Html.EditorFor(model => model.EntityTDate.DailyPDRate)
                @Html.ValidationMessageFor(model => model.EntityTDate.DailyPDRate)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.TravelAuthorization_String_TotalAllowance:
            </td>
            <td align="left" class="editor-field">
                @Html.EditorFor(model => model.EntityTDate.TotalAllowance)
                @Html.ValidationMessageFor(model => model.EntityTDate.TotalAllowance)
            </td>
            <td align="right" valign="top" class="editor-label">
                @Resources.TravelAuthorization_String_AdvanceRequired:
            </td>
            <td align="left" class="editor-field">
                @Html.EditorFor(model => model.EntityTDate.AdvanceRequired)
                @Html.ValidationMessageFor(model => model.EntityTDate.AdvanceRequired)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.Global_String_Currency:
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownListFor(model => model.EntityTDate.CurrencyId, Model.Currencies, Resources.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(model => model.EntityTDate.CurrencyId)
            </td>
            <td align="left" class="editor-label">
                @Resources.Budget_CategoryList_ProjectNo
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownList("ProjectNospp", Model.ProjectNos, Resources.Global_String_PleaseSelect, new { onchange = "javascript:selectedIndexChangeTAuthDates(this)" })
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label">
                @Resources.Budget_CreateSubLine_LineNumber
            </td>
            <td align="left" class="editor-field">
                <div id="PBlines">
                    @Html.DropDownListFor(model => model.EntityTDate.BudgetLineId, Model.BudgetLines, Resources.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(model => model.EntityTDate.BudgetLineId)
                </div>
            </td>
            <td align="left" class="editor-label">
            </td>
            <td align="left" class="editor-field">
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label">
            </td>
            <td align="left" class="editor-field">
                <input type="submit" class="btn green" value="@Resources.Global_String_Save" />
            </td>
            <td align="left" class="editor-label" colspan="2" valign="top">
            </td>
        </tr>
    </table>
}
